﻿public abstract class Manager<T> : Singleton_CSharp<T>, IManager where T : class, new()
{
    public bool IsAwake  { get { return isAwake; } }
    public bool IsInit  { get { return isInit; } }
    public bool IsInGame { get { return isInGame; } }

    private bool isAwake;
    private bool isInit;
    private bool isInGame;

    public virtual void OnAwake()
    {
        isAwake = true;
    }

    public virtual void OnInit()
    {
        isInit = true;
    }

    public virtual void OnEnterGame(bool bReconnect)
    {
        isInGame = true;
    }
    
    public virtual void OnEnterScene()
    {
        
    }

    public virtual void OnPause(bool paused)
    {
        
    }

    public virtual void OnFocus(bool focus)
    {
        
    }

    public virtual void OnDisconnect()
    {
        
    }
    public virtual void OnExitScene(bool bNewScene)
    {
        
    }
    
    public virtual void OnExitGame(bool bReconnect)
    {
        isInGame = false;
    }

    public virtual void OnDestroy()
    {
        isAwake = false;
        isInit = false;
        isInGame = false;
    }
}